<?php
/**
 * View  LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    17-mag-2011
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */
?>
<script type="text/javascript">
    //<![CDATA[
     
    $(document).ready(function()
    {
	
    });

    //]]>
</script>
<div class="info">
    <h2>Dettagli Contatto</h2>
    <div>...</div>
</div>
<div class="col2">
    <div id="detailTableLeft">
	<table cellspacing="0" class="table">
	    <caption><strong>Informazioni Contatto</strong><a class="edit" href="/admin/contatti/edit/id/<?php echo $this->data['contact_id'] ?>" title="Modifica">&nbsp;</a></caption>
	    <tbody>
		<tr>
		    <th>Nome:</th>
		    <td><?php echo $this->data['contact_firstname']?> <?php echo $this->data['contact_lastname']?></td>
		</tr>
		<tr>
		    <th>Email Principale:</th>
		    <td><?php echo $this->data['contact_email']?></td>
		</tr>
		<tr>
		    <th>Tel Principale:</th>
		    <td><?php echo $this->data['contact_phone']?></td>
		</tr>
	    </tbody>
	</table>
	<table cellspacing="0" class="table">
	    <caption><strong>Altre Informazioni</strong></caption>
	    <tfoot>
		<tr>
		    <td colspan="2">
			<a class="button" href="/users/">Modifica Informazioni</a>
		    </td>
		</tr>
	    </tfoot>
	    <tbody>
		<tr>
		    <th>Email 2:</th>
		    <td><?php echo $this->data['contact_email2']?></td>
		</tr>
		<tr>
		    <th>Email 3:</th>
		    <td><?php echo $this->data['contact_email3']?></td>
		</tr>
		<tr>
		    <th>Tel Lavoro:</th>
		    <td><?php echo $this->data['contact_work']?></td>
		</tr>
		<tr>
		    <th>Tel Privato:</th>
		    <td><?php echo $this->data['contact_mobile']?></td>
		</tr>
		<tr>
		    <th>Fax:</th>
		    <td><?php echo $this->data['contact_fax']?></td>
		</tr>
		<tr>
		    <th>Indirizzo:</th>
		    <td>
			<?php 
			if( $this->data['contact_street'] != '' )
			    echo $this->data['contact_street'] .', ';
			
			if( $this->data['contact_street_number'] != '' )
			    echo 'N&deg; '. $this->data['contact_street_number'] .'<br /> ';
			
			if( $this->data['contact_loc'] != '' )
			    echo 'Localit&aacute; '. $this->data['contact_loc'] .'<br />';
			
			if( $this->data['contact_cap'] != '' )
			    echo $this->data['contact_cap'];
			
			if( $this->data['contact_city'] != '' )
			    echo ' <strong>'. strtoupper( $this->data['contact_city'] ) .'</strong> ';
			
			if( $this->data['contact_prov'] != '' )
			    echo '('. $this->province[$this->data['contact_prov']]['short_name'] .')';
			?>
		    </td>
		</tr>
		<tr>
		    <th>Note:</th>
		    <td><?php echo $this->data['contact_notes']?></td>
		</tr>		
	    </tbody>
	</table>	
    </div>

   <div id="detailTableRight">
	<table cellspacing="0" class="table">
	    <caption><strong>Locali</strong></caption>
	    <tfoot>
		<tr>
		    <td colspan="2">
			<a class="button" href="/admin/contatti/associa/id/<?php echo $this->data['contact_id']?>">Modifica</a>
		    </td>
		</tr>
	    </tfoot>
	    <tbody>
		<?php if( count( $this->data['contact_roles'] ) ): 
			foreach($this->data['contact_roles'] AS $role ) :?>
		<tr>
		    <th class="section">Locale:</th>
		    <td class="section"><strong><?php echo $role['location_name']?></strong>, <?php echo $role['location_city'] ?> (<?php echo $this->province[$role['location_prov']]['short_name'] ?>) </td>
		</tr>
		<tr>
		    <th>Ruolo:</th>
		    <td><?php echo $this->contact_roles[$role['fab_contacts_role']]?></td>
		</tr>

		<?php endforeach;
		else:
		?><tr><th>Nessun Ruolo (Freelance)</th></tr><?php
		
		endif; ?>
	    </tbody>
	</table>
    </div> 
</div>
<br style="clear: both;" />

